#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

int main()
{int i,j;
int x=10;
int y=5;
int sx=5;
char input;
int kill=0;
int score;
int dis=0;
score=0;

int fire=0;

while(1)
{
 system("cls");

 if(kill==0)
 {for(i=0;i<sx;i++)
    printf(" ");
    printf("+\n");

}
else
{
   for(i=0;i<sx+dis;i++)
    printf(" ");
    printf("+\n");
}
   if(fire==0)
    {
        for(i=0;i<x;i++)
    printf("\n");
    }
    else
    {
        for(i=0;i<x;i++)
        {
        for(j=0;j<y;j++)
        printf(" ");
        printf("  |\n");

 }

    if(sx+dis==y+2)
    {
         kill=1;
    score++;
    dis++;
    }

    }
    fire=0;
    printf("%d\n",score);



for(j=0;j<y;j++)
    printf(" ");
    printf("  *\n");
    for(j=0;j<y;j++)
    printf(" ");
printf("*****\n");
for(j=0;j<y;j++)
    printf(" ");
printf(" * *  \n ");
 input=getch();
    if(input=='s')
    x++;
    if(input=='w')
    x--;
    if(input=='a')
    y--;
    if(input=='d')
    y++;
    if(input==' ')
        fire=1;
}

    return 0;

}
